By SAM ROBERTS Seeking the mayoralty early in 1989, David N. Dinkins skipped the funerals of a police officer and a Federal drug-enforcement agent and delivered a previously scheduled speech to inmates on Rikers Island instead. Mr. Dinkins's decision nearly cost him the election that year until another funeral -- that of a young black man killed because he ventured into a white neighborhood -- nudged New York City's fragile racial harmony even higher on the public agenda than law and order. But it was a decision that Rudolph W. Giuliani, Mr. Dinkins's Republican mayoral rival, never let the public forget. "That tells you something about his priorities," Mr. Giuliani said time and again. Mr. Dinkins defended the decision, insisting that his long-planned Rikers speech may have persuaded some inmates to change their priorities. But he also changed his. Not long after his narrow victory, he postponed a Caribbean vacation to attend the funerals of two police detectives. The chances of being murdered in New York are greater for civilians than for police officers. But the death of a police officer in the line of duty -- like that of Sean McDonald, who was buried yesterday after having been shot in a Bronx holdup last week -- underscores every person's vulnerability. And with its attendant rituals of thousands of blue uniforms closing ranks behind a fallen colleague and elected officials letting no seat go unfilled, a police funeral ranks high in the nation's iconography, as potent in symbolism and tradition as the farewells for the nation's most revered heroes. "Every day they're out there risking their lives; they would give up their lives for you," said Edward I. Koch, who attended 39 police funerals during his 12 years as Mayor. "How many people would do that?" The number of police officers killed in the line of duty in New York City has fluctuated in the 20th century -- from an average of more than five a year during Prohibition in the 1920's and early 1930's to a period in the 1950's when not one officer died for four consecutive years. It rose again in the early 1970's, when radical groups urged attacks on officers. In three years -- 1922, 1930 and 1980 -- the toll reached 10 or more. But numbers tell just part of the story. Because of medical advances and bulletproof vests, for example, fewer officers who are shot are dying from their wounds. Thomas Reppetto, a former officer who is president of the Citizens Crime Commission, recalls: "The old-time wisdom of the cop was, don't eat dinner before you went on patrol. Almost any stomach wound was fatal because peritonitis would set in." Officers as Targets Perhaps the most notorious murder of a New York police officer took place outside the city -- early in the century in Sicily, where Detective Lieut. Joseph Petrosino was killed while collecting evidence against the leaders of the Black Hand organization in Italian Harlem. In the late 1960's Eldridge Cleaver's faction of the Black Panther Party publicly encouraged killings of police officers, and the Black Liberation Army, an outgrowth of the Cleaver group, obliged. In 1971, Officers Waverly Jones and Joseph Piagentini were shot and killed on the Lower East Side. The following year, Officers Gregory Foster and Rocco Laurie were murdered in Harlem. Also in 1972 a fake report of an officer in distress sent officers to a Harlem mosque in an incident that ended with the fatal shooting of Officer Philip Cardillo. The Lindsay administration, straining to avoid racial strife, soft-pedaled theories of police assassination plots and even apologized to ministers of the mosque for the police "invasion" that left Officer Cardillo dead. "At his funeral, there was no mayor, no police commissioner," said Randy Jurgensen, the detective whose diligence helped crack the case. "Today, there's a different generation of cops, but they've never forgotten that case." Yesterday Mayor Giuliani and Police Commissioner William J. Bratton attended the funeral of Officer McDonald, the first officer killed this year. He received the Police Department's traditional inspector's funeral, given to every officer killed in the line of duty. Copyright 1994 The New York Times Company